#include "list.h"
#define NUM 5

int main(void)
{
  /* 初始化列表 */
  int arr[NUM] = { 1, 2, 3, 4, 5 };
  List *list = init_list(arr, NUM);
  print_list(list);

  /* 获取长度 */
  printf("%d\n", get_length(list));
  
  /* 插入元素 */
  insert_elem(list, 2, 10);
  printf("\n%d\n", get_length(list));
  print_list(list);

  /* 追加元素 */
  append_elem(list, 15);
  printf("\n%d\n", get_length(list));
  print_list(list);

  /* 删除元素 */
  int val = pop_elem(list, 0);
  printf("\n%d\t%d\n", get_length(list), val);
  print_list(list);

  /* 追加更多元素触发扩容 */
  append_elem(list, 1);
  append_elem(list, 1);
  append_elem(list, 1);
  append_elem(list, 1);
  append_elem(list, 0);
  append_elem(list, 0);
  printf("\n");
  print_list(list);
  printf("%d\t%d\n", get_length(list), get_capacity(list));


  return 0;
}
